const shareUtil = require('../../../utils/shareUtil.js');
var t = function(t) {
    return t && t.__esModule ? t : {
        default: t
    };
}(require("number.js"));

getApp(), 
Page({
    data: {
        space: 4
    },
    textStr: "我爱你",
    numStr: "520",
    onLoad: function(t) {},
    onReady: function() {
        this._formatText();
    },
    wordartInput: function(t) {
        this.textStr = t.detail.value, this._formatText();
    },
    numInput: function(t) {
        this.numStr = t.detail.value, this._formatText();
    },
    _formatText: function() {
        this._formatMode();
    },
    _formatMode: function() {
        for (var e = this.textStr, a = t.default.convert1(this.numStr), n = t.default.convert1(this.numStr), r = Math.min(e.length, this.numStr.length), o = 0; o < r; o++) {
            var i = e[o];
            i = this.ToDBC(i);
            for (var h = a[o], c = n[o], s = 0; s < h.length; s++) for (var u = 0; u < h[s].length; u++) 1 == h[s][u] ? (h[s][u] = i, 
            c[s][u] = i) : 0 == u ? (h[s][u] = " ".repeat(this.data.space), c[s][u] = " ".repeat(this.data.space)) : (h[s][u] = "　", 
            c[s][u] = "　");
        }
        for (var f = [], d = [], l = 0; l < r; l++) for (var p = a[l], m = n[l], x = 0; x < p.length; x++) f[x] ? (f[x] = f[x].concat(p[x]), 
        d[x] = d[x].concat(m[x])) : (f[x] = p[x].slice(0), d[x] = m[x].slice(0));
        for (var g = "", v = [], S = 0; S < f.length; S++) {
            for (var C = 1; C < f[0].length; C++) g += f[S][C], v.push(d[S][C]);
            S < f.length - 1 && (g += "\n", v.push("\n"));
        }
        this.setData({
            text: g,
            textHtml: v
        });
    },
    ToDBC: function(t) {
        var e = t;
        return 32 == t.charCodeAt(0) && (e = String.fromCharCode(12288)), t.charCodeAt(0) < 127 && (e = String.fromCharCode(t.charCodeAt() + 65248)), 
        e;
    },
    tapCopy: function() {
        var that = this;
        wx.setClipboardData({
          data: that.data.text,
          success: function() {
              wx.showToast({
                  title: "复制成功"
              });
          }
        });
    },
    changeSpace: function(t) {
        var e = t.currentTarget.dataset.id;
        e != this.data.space && (this.setData({
            space: e
        }), this._formatMode());
    },
    onShareAppMessage:shareUtil.shareConfig,
    onShareTimeline:shareUtil.shareConfig,
});